package org.labo.sigmalivepaper;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;

class Sprite {

	private Bitmap bitmap;
	private Paint paint;
	
	float centerX;
	float centerY;
	float offsetX;
	float offsetY;
	
	float x;
	float y;
	
	float dX;
	float dY;

	public Sprite(Context context) {

		bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.sigma);
		offsetX = bitmap.getWidth() / 2;
		offsetY = bitmap.getHeight() / 2;

		paint = new Paint();
		paint.setAntiAlias(true);
		paint.setFilterBitmap(true);
	}

	public void draw(Canvas canvas) {
		centerX = canvas.getWidth() / 2;
		centerY = canvas.getHeight() / 2;

		x =  centerX - offsetX;
		y =  centerY - offsetY;
		
		canvas.drawBitmap(bitmap, x + dX, y+ dY, paint);
	}

	public float getdX() {
		return dX;
	}

	public void setdX(float dX) {
		this.dX = dX;
	}

	public float getdY() {
		return dY;
	}

	public void setdY(float dY) {
		this.dY = dY;
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public float getOffsetX() {
		return offsetX;
	}

	public float getOffsetY() {
		return offsetY;
	}
	
	
			
}
